package com.example.reflect;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ListenerInvocationHandler<T> implements InvocationHandler {

    private T t;
    private Method method;

    public ListenerInvocationHandler(T t, Method method) {
        this.t = t;
        this.method = method;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        return this.method.invoke(t,args);
    }
}
